﻿using Century.Business.CMS;
using Century.Web.UI.MVC;
using System.Linq;
using System.Web.Mvc;


namespace Century.Admin.Controllers
{
    public class CMSMenuController : CenturyAdminBaseController
    {
        //
        // GET: /GkfxCommon/Menu/
        public CMSMenuController(ISiteService siteService) : base(siteService) { }

   
        public ActionResult TopMenu()
        {
            var MenuList = siteService.GetSitePages(Token.CurrentSite.Id);
            var menuPages = MenuList.ToList().OrderBy(r => r.NodeOrder).ToList();

            return View(menuPages);

        }
        public ActionResult FooterMenu()
        {

            var menuPages = siteService.GetSitePages(Token.CurrentSite.Id).Where(r => r.ParentId == null && r.IsHomePage == false && r.ShowInMenu == true && r.DraftSourcePageId <= 0 && r.IsPublished == true).ToList().OrderBy(r => r.NodeOrder).ToList();

            return View(menuPages);

        }
       
         
    }
}
